<?php

namespace App\AdminFields;

use App\Admin\Form\Field;

class Lottos extends Field
{
    protected $view = 'admin_fields.lottos.lottos';

    protected $width = [
        'label' => 150,
        'field' => 500,
    ];

    public function render()
    {
        $this->script = $this->getScriptFromView('admin_fields.lottos.script');

        return parent::render();
    }

    protected function getScriptFromView($view)
    {
        $script = view($view)->render();

        $script = str_after($script, '<script>');
        $script = str_before($script, '</script>');

        return $script;
    }
}